
<?
include('../db/koneksi.php');
include('../db/manipulasi_table.php');
include '../lib/function.upload_file_int.php';
//==========================insert table================================
if($_FILES["foto"]["name"] !="" ){

			$lokasi = "../gambar/guru/";
                        if(!is_dir($lokasi))
                        {
                            mkdir($lokasi);   
                        }
                        
			$nama_dest = $no_kunjungan."_".date("Ymd").substr($_FILES["foto"]["name"], -4);
			$photopegawai = upload_file_int("foto", $nama_dest, $lokasi);
			$InsertMstGuru["foto"]=$lokasi."".$nama_dest;

		}
$InsertMstGuru['kd_guru']=$_POST['kd_guru'];
$InsertMstGuru['nm_guru']=$_POST['nm_guru'];
$InsertMstGuru['alamat']=$_POST['alamat'];
$InsertMstGuru['tmpt_lahir']=$_POST['tmpt_lahir'];
$InsertMstGuru['tgl_lahir']=$_POST['tgl_lahir'];
$InsertMstGuru['tgl_masuk']=$_POST['tgl_masuk'];
$InsertMstGuru['email']=$_POST['email'];
$InsertMstGuru['nohp']=$_POST['nohp'];
$InsertMstGuru['jenkel']=$_POST['jenkel'];
$InsertMstGuru['agama']=$_POST['agama'];
insert_table('mst_guru',$InsertMstGuru);
echo "<script>window.close();window.opener.location.reload(); </script>";
//============================= END ============================